const TokenKey = "Admin-Token";

export function getToken(): string | null {
	return localStorage.getItem(TokenKey);
}

export function setToken(token) {
	return localStorage.setItem(TokenKey, token);
}

export function removeToken() {
	return localStorage.removeItem(TokenKey);
}

// 翻译字典值
export function dictName(key, list) {
	const item = list.find((item) => {
		return item["value"] === key;
	});
	return item ? item["label"] : "-";
}
